package exercise.day05;

public class ExtendedExercise {
    public static void main(String[] args) {

        int num = 0;
        for (int i = 0; i <= 100; i++) {
            num += i;
        }
        System.out.println(num);

        int guess = 1;
        for (int a = 1; a < 8; a++) {
            guess *= a;
        }
        System.out.println(guess);

        for (int a = 11; a >= 1; a--) {
            for (int b = 11; b >= a; b--) {
                System.out.print("*");
            }
            System.out.println();
        }
        System.out.println("---------");
        for (int a = 1; a <= 10; a++) {
            if (a % 2 != 0) {
                for (int b = 1; b <= a; b++) {
                    System.out.print("*");
                }
                System.out.println();
            }

        }
        int[] arr = new int[10];

        for (int i = 0; i < arr.length; i++) {
            arr[i] = (int) (Math.random() * 50);
            System.out.print(arr[i] + " ");
        }
        System.out.println();
        int max = arr[0];
        int min = arr[0];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = (int) (Math.random() * 50);
            System.out.print(arr[i] + " ");
            if (max < arr[i]) {
                max = arr[i];
            } else if (min > arr[i]) {
                min = arr[i];
            }
        }
        System.out.println();
        System.out.print("最大值:" + max + "最小值：" + min);
        System.out.println();
        int a = 9;
        while (a >= 1) {
            int b = a;
            while (b >= 1) {
                System.out.print(a + "*" + b + "=" + a * b + " \t");
                b--;
            }
            System.out.println();
            a--;
        }
        for(int i=1;i<=10;i++){
            if(i%2!=0) {
                for (int j = 1; j <= i; j++) {
                    System.out.print("*");
                }
                System.out.println();
            }

        }
    }
}
